import http.cookiejar
import urllib.request

url='https://www.zhipin.com/web/geek/job-recommend'
# 创建CookieJar对象
cookie_jar = http.cookiejar.CookieJar()

# 创建HTTPCookieProcessor
cookie_processor = urllib.request.HTTPCookieProcessor(cookie_jar)

# 创建Opener
opener = urllib.request.build_opener(cookie_processor)

# 发送GET请求
response = opener.open(url)

print(response.text)

# 获取服务器返回的Cookie
for cookie in cookie_jar:
    print(f"Name: {cookie.name}, Value: {cookie.value}")
